
local mt = ac.skill['扫射']
mt.temp = '攻击触发'
mt.model = [[war3mapImported\ClinkzBow_3g.mdx]]


function mt:on_run(hero)
    hero:add_buff '扫射'{
        art = self.art,
        tip = [[攻速提升]],
        time = 5,
        on_add = function(buff)
            buff:gc(hero:add_effect(self.model,'weapon'))
            buff:gc(hero:add('攻击速度',self.data1))
        end
    }
end



local mt = ac.skill['炽烈火雨']
mt.model = [[Abilities\Weapons\SearingArrow\SearingArrowMissile.mdl]]

function mt:dmg_tip()
    local hero = self.owner
    if hero then
        if japi.GetKeyState(KEY.ALT) then
            return ('|cffffcc99%0.f%%敏捷|r'):format(self.data1)
        else
            return ('|cffffcc99%s|r(|cff00ff00按alt查看公式|r)'):format(format_number1(hero:get('敏捷') * self.data1/100))
        end
    end
end

function mt:on_add()
    local hero = self.owner
    self:gc(hero:add('敏捷成长',self.data2))
    self:gc(hero:add_buff '弹道'{
        arc = 0,
        speed = 1500,
        model = self.model,
    })
    self:gc(hero:event '单位-攻击命中'(function(_,_,target,data)
        local damage = hero:get('敏捷') * self.data1/100
        target:damage{
            source = hero,
            damage = damage,
            skill = self,
        }
    end))
end

